package com.eptok.test;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.concurrent.Callable;

import com.eptok.db.DBManager;

public class ReConnectionTask implements Callable {

	public Object call() throws Exception {
		Connection cn = null;
		long s_date = 0;
		long e_date = 0;
		try{
			s_date = System.currentTimeMillis();
			cn = DBManager.getBossConnection();
			e_date = System.currentTimeMillis();
			System.out.println(Thread.currentThread().getName()+" dis_normal_time = "+ (e_date - s_date));
		}catch(Exception e){
			e_date = System.currentTimeMillis();
			System.out.println(Thread.currentThread().getName()+" dis_exception_time = "+ (e_date - s_date));
		}finally{
			if(cn!=null){
				try {
					cn.close();
				} catch (SQLException e) {
					e.printStackTrace();
				}
			}
		}
		return null;
	}

}
